import { GET, POST } from '@/utils'

enum API {
    ADD_DEVICE_API = '/addDevice',
    GET_DEVICE_API = '/queryDevice',
    UPDATE_DEVICE_API = '/updateDevice',
    DELETE_DEVICE_API = '/deleteDevice',
    EXPORT_ALL_DECICE_API = '/downloadDevice',

    GET_DEVICE_THRESHOLD_API = '/queryAlarmLimit',
    UPDATE_DEVICE_THRESHOLD_API = '/updateAlarmLimit',

    SET_VIDEOS_API = '/changeVideos',
    SET_VERSION_API = '/downVersion',

    DOWNLOAD_MODEL_API = '/downloadDeviceModel',
    UPLOAD_MODEL_API = '/uploadDevice'
}

export const addDeviceApi = (data: any) => POST(API.ADD_DEVICE_API, data, false)
export const getDeviceApi = (data: any) => POST(API.GET_DEVICE_API, data, false)
export const updateDeviceApi = (data: any) => POST(API.UPDATE_DEVICE_API, data, false)
export const delDeviceApi = (data: any) => POST(API.DELETE_DEVICE_API, data, true)
export const exportAllDataApi = (data: any) => POST(API.EXPORT_ALL_DECICE_API, data, false)
export const getDeviceThresholdApi = (data: any) => POST(API.GET_DEVICE_THRESHOLD_API, data, false)
export const updateDeviceThresholdApi = (data: any) => POST(API.UPDATE_DEVICE_THRESHOLD_API, data, false)
export const updateDeviceVideodApi = (data: any) => POST(API.SET_VIDEOS_API, data, false)
export const updateDeviceVersionApi = (data: any) => POST(API.SET_VERSION_API, data, false)
export const downloadModelApi = () => GET(API.DOWNLOAD_MODEL_API)
export const uploadModelApi = (data: any) => POST(API.UPLOAD_MODEL_API, data, false)